<template> 
	<div class="enterpriseImage">  
		<!-- 企业画像年份导航栏 -->
		<div class="enterImg_nav"> 
			<div class="enterImg_nav_item" v-for="(item,index) in yearData"
			 :class="yearnum==item ? 'active':''" @click="toNum(item)">{{item}}年</div>
			<!-- <div class="enterImg_nav_item" :class="yearnum==2019 ? 'active':''" @click="toNum(2019)">2019年</div>
			<div class="enterImg_nav_item" :class="yearnum==2018 ? 'active':''" @click="toNum(2018)">2018年</div>
		 -->
		</div>
		<div class="enterImg_list">
			<!-- 表格4个圆点 -->
			<div class="lineRadius l1"></div>
			<div class="lineRadius l2"></div>
			<div class="lineRadius r1"></div>
			<div class="lineRadius r2"></div>
			<!-- 价值评分图标 -->
			<!-- <div class="enterImg_echarts">
				<imageEcharts ></imageEcharts>
			</div> -->
			<!-- 企业画像规模实力详情 -->
			<div class="enterImg_item">
				<img class="item_title" src="../../../public/images/enterprise/qyhx1@2x.png" alt="">
				<div class="item_title_first">
					规模实力 {{baseData.report_date}}年 <img src="../../../public/images/enterprise/biaoti@2x.png" alt="">
				</div>
				<div class="item_contentlist">
					<div class="item_contentli">
						<div class="contentli_left">
							<div class="line"></div>营业收入
						</div>
						<div class="contentli_right">
							<span>{{baseData.sales|datum}}</span>万元
						</div>
					</div>
					<div class="item_contentli">
						<div class="contentli_left">
							<div class="line"></div>净资产
						</div>
						<div class="contentli_right">
							<span>{{baseData.net_assets|datum}}</span>万元
						</div>
					</div>
					<div class="item_contentli">
						<div class="contentli_left">
							<div class="line"></div>利润总额
						</div>
						<div class="contentli_right">
							<span>{{baseData.profit|datum}}</span>万元
						</div>
					</div>
					<div class="item_contentli">
						<div class="contentli_left">
							<div class="line"></div>年纳税总额
						</div>
						<div class="contentli_right">
							<span>{{baseData.tax|datum}}</span>万元
						</div>
					</div>
					<div class="item_contentli">
						<div class="contentli_left">
							<div class="line"></div>企业市值或估值
						</div>
						<div class="contentli_right">
							<span>{{baseData.market_value|datum}}</span>万元
						</div>
					</div>
				</div>
			</div>
			<!-- 企业画像成长能力详情 -->
			<div class="enterImg_item">
				<img class="item_title" src="../../../public/images/enterprise/qyhx2@2x.png" alt="">
				<div class="item_title_first">
					成长能力 {{baseData.report_date}}年<img src="../../../public/images/enterprise/biaoti@2x.png" alt="">
				</div>
				<div class="item_contentlist">
					<div class="item_contentli">
						<div class="contentli_left">
							<div class="line"></div>营收同比增长率
						</div>
						<div class="contentli_right">
							<span>{{baseData.sales_growth_rate|datum}}</span>%
						</div>
					</div>
					<div class="item_contentli">
						<div class="contentli_left">
							<div class="line"></div>净资产同比增长率
						</div>
						<div class="contentli_right">
							<span>{{baseData.net_assets_growth_rate|datum}}</span>%
						</div>
					</div>
					<div class="item_contentli">
						<div class="contentli_left">
							<div class="line"></div>税收同比增长率
						</div>
						<div class="contentli_right">
							<span>{{baseData.tax_growth_rate|datum}}</span>%
						</div>
					</div>
					<div class="item_contentli">
						<div class="contentli_left">
							<div class="line"></div>员工规模同比增长率
						</div>
						<div class="contentli_right">
							<span>{{baseData.people_growth_rate|datum}}</span>%
						</div>
					</div>
					<div class="item_contentli">
						<div class="contentli_left">
							<div class="line"></div>发明专利同比增长率
						</div>
						<div class="contentli_right">
							<span>{{baseData.inventive_patent_growth_rate|datum}}</span>%
						</div>
					</div>
				</div>
			</div>
			<!-- 企业画像投融资能力详情 -->
			<div class="enterImg_item">
				<img class="item_title" src="../../../public/images/enterprise/qyhx3@2x.png" alt="">
				<div class="item_title_first">
					投融资能力 {{baseData.report_date}}年<img src="../../../public/images/enterprise/biaoti@2x.png" alt="">
				</div>
				<div class="item_contentlist">
					<div class="item_contentli">
						<div class="contentli_left">
							<div class="line"></div>企业融资次数
						</div>
						<div class="contentli_right">
							<span>{{baseData.financing_count|datum}}</span>次
						</div>
					</div>
					<div class="item_contentli">
						<div class="contentli_left">
							<div class="line"></div>企业融资总金额
						</div>
						<div class="contentli_right">
							<span>{{baseData.financing_value|datum}}</span>万元
						</div>
					</div>
					<div class="item_contentli">
						<div class="contentli_left">
							<div class="line"></div>企业对外投资数量
						</div>
						<div class="contentli_right">
							<span>{{baseData.invest_count|datum}}</span>次
						</div>
					</div>
					<div class="item_contentli">
						<div class="contentli_left">
							<div class="line"></div>企业对外投资总金额
						</div>
						<div class="contentli_right">
							<span>{{baseData.invest_value|datum}}</span>万元
						</div>
					</div>
					<div class="item_contentli">
						<div class="contentli_left">
							<div class="line"></div>企业对外并购总金额
						</div>
						<div class="contentli_right">
							<span>{{baseData.merger_value|datum}}</span>万元
						</div>
					</div>
				</div>
			</div>
			<!-- 企业画像盈利能力详情 -->
			<div class="enterImg_item">
				<img class="item_title" src="../../../public/images/enterprise/qyhx4@2x.png" alt="">
				<div class="item_title_first">
					盈利能力 {{baseData.report_date}}年<img src="../../../public/images/enterprise/biaoti@2x.png" alt="">
				</div>
				<div class="item_contentlist">
					<div class="item_contentli">
						<div class="contentli_left">
							<div class="line"></div>净资产收益率
						</div>
						<div class="contentli_right">
							<span>{{baseData.roe|datum}}</span>%
						</div>
					</div>
					<div class="item_contentli">
						<div class="contentli_left">
							<div class="line"></div>利润率
						</div>
						<div class="contentli_right">
							<span>{{baseData.profit_margin|datum}}</span>%
						</div>
					</div>
					<div class="item_contentli">
						<div class="contentli_left">
							<div class="line"></div>人均产值
						</div>
						<div class="contentli_right">
							<span>{{baseData.output_value_per|datum}}</span>万元/人
						</div>
					</div>
					<div class="item_contentli">
						<div class="contentli_left">
							<div class="line"></div>人均利润
						</div>
						<div class="contentli_right">
							<span>{{baseData.profit_per|datum}}</span>万元/人
						</div>
					</div>
					<div class="item_contentli">
						<div class="contentli_left">
							<div class="line"></div>人均税收
						</div>
						<div class="contentli_right">
							<span>{{baseData.tax_per|datum}}</span>万元/人
						</div>
					</div>
				</div>
			</div>
			<!-- 企业画像创新能力详情 -->
			<div class="enterImg_item">
				<img class="item_title" src="../../../public/images/enterprise/qyhx5@2x.png" alt="">
				<div class="item_title_first">
					创新能力 {{baseData.report_date}}年<img src="../../../public/images/enterprise/biaoti@2x.png" alt="">
				</div>
				<div class="item_last">
					<div class="item_last_li">
						<div class="item_contenttitle">
							创新投入
						</div>
						<div class="item_contentli" style="margin-bottom: 42px;">
							<div class="contentli_left">
								<div class="line"></div>研发投入金额
							</div>
							<div class="contentli_right">
								<span> {{baseData.research_cost|datum}}</span>万元
							</div>
						</div>
						<div class="item_contentli" style="margin-bottom: 42px;">
							<div class="contentli_left">
								<div class="line"></div>研发投入/营收
							</div>
							<div class="contentli_right">
								<span> {{baseData.research_sales|datum}}</span>%
							</div>
						</div>
						<div class="item_contentli">
							<div class="contentli_left">
								<div class="line"></div>研发人员
							</div>
							<div class="contentli_right">
								<span> {{baseData.research_people|datum}}</span>人
							</div>
						</div>
					</div>
					<div class="item_last_li">
						<div class="item_contenttitle">
							创新产出
						</div>
						<div class="item_contentli" style="margin-bottom: 42px;">
							<div class="contentli_left">
								<div class="line"></div>驰名商标
							</div>
							<div class="contentli_right">
								<span> {{cnewData.famous_trademark|datum}}</span>件
							</div>
						</div>
						<div class="item_contentli" >
							<div class="contentli_left">
								<div class="line"></div>发明专利
							</div>
							<div class="contentli_right">
								<span> {{cnewData.authorization_inventive_patent|datum}}</span>件
							</div>
						</div>
					</div>
				</div>
				
				<!-- <div class="item_contentlist">
					
					
				</div> -->
			</div>
		</div>
	</div>
</template>

<script>
	// import imageEcharts from './imageEcharts.vue'
	export default{
		name:'enterpriseImage',
		data() {
			return{
				enterimgNum:0,
				sbcompany:'',
				baseData:[],
				cnewData:[],
				yearnum:'',
				yearData:[]
			}
		},
		mounted() {
			
			this.getYeardata()
		},
		// components:{
		// 	imageEcharts
		// }, 
		filters:{
			datum(value) { 
			      if(value){
					  return value
				  }else{
					  return '--'
				  }
			    },
		},
		methods:{
			async getYeardata(){
				this.sbcompany=this.$route.query.comname
				// 请求年份
				var dtt = {
					"params": {
						"normGuid": "f7f356b8-76dc-4c4e-8244-9d06963a7b0a",
							"fieldList": [{
								"key":"company_name",
								"value":this.sbcompany
							}]
						}
				};
				const yearr = await this.$api.post('dcockpit/rest/cockpitApi/searchListNormResult', dtt)
				let {custom:{result:resulty}}={...yearr}
				resulty.cockpitData.forEach(item=>{
					this.yearData.push(item.report_date)
				})
				
				this.yearnum=this.yearData[0]
				
				this.getBasedata()
			},
			// 获取企业画像基本数据
			
			async getBasedata(){
				this.sbcompany=this.$route.query.comname
				
				var dt = {
					"params": {
						"normGuid": "f7f356b8-76dc-4c4e-8244-9d06963a7b0a",
							"fieldList": [{
								"key":"company_name",
								"value":this.sbcompany
							},{
								"key":"report_date",
								"value":this.yearnum,
								}]
						}
				};
				const aaa = await this.$api.post('dcockpit/rest/cockpitApi/searchListNormResult', dt)
				let {custom:{result}}={...aaa}
				this.baseData=result.cockpitData[0]
					var dt1 = {
						"params": {
							"normGuid": "a29bf37c-7d27-419f-a5e9-a3e708155bea",
								"fieldList": [{
									"key":"company_name",
									"value":this.sbcompany
								},{
									"key":"report_date",
									"value":this.yearnum,
									}]
							}
					};
					const bbb = await this.$api.post('dcockpit/rest/cockpitApi/searchListNormResult', dt1)
					let {custom:{result:result1}}={...bbb}
					this.cnewData=result1.cockpitData[0]
			},
			// 切换年限,改变数据
			toNum(e){
				this.yearnum=e
				this.$nextTick(()=>{
					this.getBasedata();
				})
			}
		}
	}
</script>

<style lang="stylus" rel='stylesheet/stylus' scoped>
	@import "~@/assets/enterpriseImage.styl"
</style>
